﻿@{
    Layout = null;
    var templetModel = ViewBag.templetModel as NB.MGJ.Model.Origins_Templet;
}
<!--溯源节点版本库  新增-->
<!DOCTYPE html>

<link href="~/Content/Manger/tabletree4j.css" rel="stylesheet" />
<script src="~/Scripts/tableTree/TableTree4J.js"></script>
<link href="~/Scripts/Bootstrap/css/bootstrap-datepicker3.min.css" rel="stylesheet" />
<script src="~/Scripts/Bootstrap/js/bootstrap-datepicker.js"></script>
<link href="~/Content/TraceSource/AddOriginsTemplet_P.css" rel="stylesheet" />
<script src="~/Scripts/MGJJS/OriginsTemplet/OriginsTemplet_CP.js"></script>


@*<template id="mytemplate">
    <img src="" alt="great image">
    <div class="comment"></div>
</template>*@



<div>

    <!-- Nav tabs -->
    <ul class="nav nav-tabs" id="myTab">
        <li class="active">
            <a href="#Template_form" id="menu__" data-toggle="tab" onclick="OriginsTemplet.CutButtonMenu()">
                溯源节点目录
            </a>
        </li>
        <li>
            <a href="#config" id="config_" data-toggle="" onclick="OriginsTemplet.CutButtonInfo()">
                溯源节点配置
            </a>
        </li>
    </ul>

    <!-- Tab panes -->
    <div id="myTabContent" class="tab-content margin-top-20">
        <!--模板名称-->
        <form id="Template_form" class="tab-pane fade in active">
            <div id="menu_">
                <div role="tabpanel" class="tab-pane active" id="basicInfo">
                    <div style="display:flex">
                        <!--左边树形类目-->
                        <div id="gridTreeDiv" class="col-xs-6 col-sm-6 col-md-6 col-lg-6"></div>
                        <!--右边-->
                        <div id="menu_right"  class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                             <!--隐藏的类目ID-->
                            <input type="hidden" name="ClassifyId" value="@templetModel.ClassifyId" />
                            <input type="hidden" name="TempletId" id="TempletId" value="@templetModel.TempletId" />
                            <div class="form-group row">
                                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 text-right font-size-14">节点目录:</div>
                                <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                                    <input class="form-control" type="text" id="ClassifyName" value="@templetModel.ClassifyName" disabled>
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 text-right font-size-14"><span class="red-700">*</span>模板名称:</div>
                                <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                                    <input class="form-control" type="text" name="Name" value="@templetModel.Name" placeholder="请输入模板名称" maxlength="50">
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 text-right font-size-14"><span class="red-700">*</span>模板编号:</div>
                                <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                                    <input class="form-control" type="text" name="Code" value="@templetModel.Code" placeholder="请输入模板编号" maxlength="50">
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 text-right font-size-14">备注:</div>
                                <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                                    <input class="form-control" type="text" name="Remark" value="@templetModel.Remark">
                                </div>
                            </div>
                            <div class="text-right">
                                <button class="btn btn-success" type="button" onclick="OriginsTemplet.Ajax_SaveOriginsTemplet()">保存</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <!--节点配置添加-->
        <div class=" tab-pane fade" id="config">
            @Html.Partial("NodeConfigAdd_PV")
        </div>
    </div>
</div>
<script>
    $('#Template_form').bootstrapValidator({
        excluded: [":disabled"],
        fields: {
            Name: {
                validators: {
                    notEmpty: {
                        message: '模板名称不能为空'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9_ \u4e00-\u9fa5]+$/,
                        message: '模板名称不能输入符号'
                    },
                    stringLength: {
                        max: 50,
                        message: '模板名称最大长度为50',
                    }
                }
            },
            Code: {
                validators: {
                    notEmpty: {
                        message: '模板编号不能为空'
                    },
                    regexp: {
                        regexp: /^\d+$/,
                        message: '模板编号只能为整数'
                    },
                    stringLength: {
                        max: 50,
                        message: '模板编号最大长度为50',
                    }
                }
            },
        }
    });
</script>